#ifndef TINYNDARRAY_INTERNAL_UNARY_H
#define TINYNDARRAY_INTERNAL_UNARY_H
#include <functional>
#include <sstream>
#include <type_traits>
#include <vector>

#include "misc.h"

namespace tinyndarray {
template <typename F>
NdArray ApplyUnaryOp(const NdArray& x, F op) {
    NdArray ret(x.dtype(), x.shape());
    ApplyOpSimple(ret, x, op);
    return ret;
}

template <typename F>
NdArray ApplyUnaryOpInplace(NdArray&& x, F op) {
    ApplyOpSimple(x, x, op);
    return std::move(x);
}

}
#endif